from django.db import models

from idcs.models import Idc


# Create your models here.
class Cabinet(models.Model):
    idc = models.ForeignKey(to=Idc, verbose_name='所属机房', help_text='机柜所在机房')
    name = models.CharField(max_length=128, verbose_name='机柜名称', help_text='机柜名称，命名应可以定位到具体位置', unique=True)
    ctime = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'cabinet'
        ordering = ['-ctime', 'name']
        verbose_name_plural = verbose_name = '机柜信息'
